package com.showgood.vo;
import org.apache.log4j.Logger;
public class VoFactory {
private Logger logger = Logger.getLogger(getClass());
public static final int VERSION = 1106030831;
public static final int VO_BASEVO = 1;
public static final int VO_IDVO = 2;
public static final int VO_NAMEVO = 3;
public static final int VO_LOGINVO = 4;
public static final int VO_REPLYLOGINVO = 5;
public static final int VO_MANVO = 6;
public static final int VO_RECTVO = 7;
public static final int VO_LOCATIONVO = 8;
public static final int VO_CITYDETAILVO = 9;
public static final int VO_CITYVO = 10;
public static final int VO_ERRORVO = 11;
public static final int VO_ARMYSETUPVO = 12;
public static final int VO_ARMYVO = 13;
public static final int VO_ARMYDETAILVO = 14;
public static final int VO_FIGHTINGVO = 15;
private static BaseVO[] prototype = new BaseVO[]{
new IdVO(), // 2
new NameVO(), // 3
new LoginVO(), // 4
new ReplyLoginVO(), // 5
new ManVO(), // 6
new RectVO(), // 7
new LocationVO(), // 8
new CityDetailVO(), // 9
new CityVO(), // 10
new ErrorVO(), // 11
new ArmySetupVO(), // 12
new ArmyVO(), // 13
new ArmyDetailVO(), // 14
new FightingVO(), // 15
};
public BaseVO create(int vid) {
try {
BaseVO vo = (BaseVO)prototype[vid-2].clone();
assert vo.getVid() == vid;
return vo;
} catch (CloneNotSupportedException e) {
logger.error("CREATE VO ERROR",e);
return null;
}}
private static VoFactory instance;
public static VoFactory getInstance() {if(instance==null){instance=new VoFactory();}return instance;}

}
